
#ifndef _ka_app_app_h
#define _ka_app_app_h

#include "ka-system/context.h"

namespace ka {
    class IApplicationImpl {
    public:
        virtual ~IApplicationImpl();
        virtual int run(int argc, char *argv[]) = 0;
    };
    
    class Application : public Context {
    public:
        /**
         * The uid of Application Events
         */
        static const UUID EVENT_UID;
        
        enum {
            ACTION_NONE,
            ACTION_LAUNCHED,
            ACTION_PAUSED,
            ACTION_RESUMED,
            ACTION_SUSPENDED,
            ACTION_CONTINUED,
            ACTION_TERMINATED,
        };
        
        Application();
        explicit Application(IApplicationImpl *impl);
        void setContextManifest(IContextManifest *mfest);
        int run(int argc, char *argv[]);
        static IApplicationImpl *getDefaultImpl();
    private:
        IApplicationImpl *_impl;
        IContextManifest *_mfest;
    };
}

#endif